import {createAsyncThunk,createSlice} from '@reduxjs/toolkit'
import * as services from 'services/Consultationinformation/CheckoutThereViews'
import { addBuilder } from 'store/dict'

export const doCheckoutThereViews = createAsyncThunk<any,any>(
    'CheckoutThereViews/doCheckoutThereViews',
    async(data)=>{
        const res = await services.CheckoutThereViews(data)
        return res
    }
)

const initialState = {
    CheckoutThereViews:{}
}

const CheckoutThereViews = createSlice({
    name:'CheckoutThereViews',
    initialState,
    reducers:{},
    extraReducers:(builder)=>{
        addBuilder(builder,doCheckoutThereViews,(state,action)=>{
            console.log(action);
            const {result} = action.payload
            state.CheckoutThereViews = result
        })
        }
    }
)

export default CheckoutThereViews.reducer

export const CheckoutThereViewsSelector = (state:any) => {
    return state.CheckoutThereViews.CheckoutThereViews
}